package com.cheng.io.print;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * 使用缓冲流包装标准输入流，实现Scanner键入效果
 */
public class SystemInTest03 {
    public static void main(String[] args) {
        try (
                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        ) {
            String readLine;
            while ((readLine = bufferedReader.readLine()) != null) {
                if ("exit".equals(readLine)) break;
                System.out.println(readLine);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
